<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />


<meta name="author" content="Yiying Wang" />

<meta name="date" content="2017-03-15" />

<title>Basic Plots 03 - Line/Area</title>

<script src="libs/jquery-1.11.3/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="libs/bootstrap-3.3.5/css/cosmo.min.css" rel="stylesheet" />
<script src="libs/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="libs/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="libs/bootstrap-3.3.5/shim/respond.min.js"></script>
<script src="libs/navigation-1.1/tabsets.js"></script>
<script src="libs/htmlwidgets-0.8/htmlwidgets.js"></script>
<script src="libs/echarts-2.2.7/echarts-all.js"></script>
<script src="libs/charts-ext-2.2.7/main.js"></script>
<script src="libs/charts-ext-2.2.7/BMap.js"></script>
<script src="libs/echarts-binding-0.2/echarts.js"></script>


<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
div.sourceCode { overflow-x: auto; }
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
  margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
code > span.dt { color: #902000; } /* DataType */
code > span.dv { color: #40a070; } /* DecVal */
code > span.bn { color: #40a070; } /* BaseN */
code > span.fl { color: #40a070; } /* Float */
code > span.ch { color: #4070a0; } /* Char */
code > span.st { color: #4070a0; } /* String */
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
code > span.ot { color: #007020; } /* Other */
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
code > span.fu { color: #06287e; } /* Function */
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
code > span.cn { color: #880000; } /* Constant */
code > span.sc { color: #4070a0; } /* SpecialChar */
code > span.vs { color: #4070a0; } /* VerbatimString */
code > span.ss { color: #bb6688; } /* SpecialString */
code > span.im { } /* Import */
code > span.va { color: #19177c; } /* Variable */
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code > span.op { color: #666666; } /* Operator */
code > span.bu { } /* BuiltIn */
code > span.ex { } /* Extension */
code > span.pp { color: #bc7a00; } /* Preprocessor */
code > span.at { color: #7d9029; } /* Attribute */
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
</style>
<style type="text/css">
  pre:not([class]) {
    background-color: white;
  }
</style>


<style type="text/css">
h1 {
  font-size: 34px;
}
h1.title {
  font-size: 38px;
}
h2 {
  font-size: 30px;
}
h3 {
  font-size: 24px;
}
h4 {
  font-size: 18px;
}
h5 {
  font-size: 16px;
}
h6 {
  font-size: 12px;
}
.table th:not([align]) {
  text-align: left;
}
</style>

<link rel="stylesheet" href="/home/madlogos/R/x86_64-pc-linux-gnu-library/3.3/knitr/misc/vignette.css" type="text/css" />

</head>

<body>

<style type = "text/css">
.main-container {
  max-width: 940px;
  margin-left: auto;
  margin-right: auto;
}
code {
  color: inherit;
  background-color: rgba(0, 0, 0, 0.04);
}
img {
  max-width:100%;
  height: auto;
}
.tabbed-pane {
  padding-top: 12px;
}
button.code-folding-btn:focus {
  outline: none;
}
</style>



<div class="container-fluid main-container">

<!-- tabsets -->
<script>
$(document).ready(function () {
  window.buildTabsets("TOC");
});
</script>

<!-- code folding -->






<div class="fluid-row" id="header">



<h1 class="title toc-ignore">Basic Plots 03 - Line/Area</h1>
<h4 class="author"><em>Yiying Wang</em></h4>
<h4 class="date"><em>2017-03-15</em></h4>

</div>

<div id="TOC">
<ul>
<li><a href="#introduction"><span class="toc-section-number">1</span> Introduction</a></li>
<li><a href="#function-call"><span class="toc-section-number">2</span> Function Call</a></li>
<li><a href="#showcase"><span class="toc-section-number">3</span> Showcase</a><ul>
<li><a href="#data-preparation"><span class="toc-section-number">3.1</span> Data Preparation</a></li>
<li><a href="#line-chart"><span class="toc-section-number">3.2</span> Line Chart</a><ul>
<li><a href="#singular-series"><span class="toc-section-number">3.2.1</span> Singular Series</a></li>
<li><a href="#multiple-series"><span class="toc-section-number">3.2.2</span> Multiple Series</a></li>
<li><a href="#stacked-line-chart"><span class="toc-section-number">3.2.3</span> Stacked Line Chart</a></li>
<li><a href="#line-width-mapped-to-weight"><span class="toc-section-number">3.2.4</span> Line Width Mapped to <code>Weight</code></a></li>
<li><a href="#line-chart-with-timeline"><span class="toc-section-number">3.2.5</span> Line Chart with Timeline</a></li>
</ul></li>
<li><a href="#curve-smooth-line-chart"><span class="toc-section-number">3.3</span> Curve (Smooth Line) Chart</a><ul>
<li><a href="#tiled-smooth-line-chart"><span class="toc-section-number">3.3.1</span> Tiled Smooth Line Chart</a></li>
<li><a href="#stacked-smooth-line-chart"><span class="toc-section-number">3.3.2</span> Stacked Smooth Line Chart</a></li>
</ul></li>
<li><a href="#area-chart"><span class="toc-section-number">3.4</span> Area Chart</a><ul>
<li><a href="#tiled-area-chart"><span class="toc-section-number">3.4.1</span> Tiled Area Chart</a></li>
<li><a href="#stacked-area-chart"><span class="toc-section-number">3.4.2</span> Stacked Area Chart</a></li>
</ul></li>
<li><a href="#wave-smooth-area-chart"><span class="toc-section-number">3.5</span> Wave (Smooth Area) Chart</a><ul>
<li><a href="#tiled-smooth-area-chart"><span class="toc-section-number">3.5.1</span> Tiled Smooth Area Chart</a></li>
<li><a href="#stacked-smooth-area-chart"><span class="toc-section-number">3.5.2</span> Stacked Smooth Area Chart</a></li>
</ul></li>
</ul></li>
<li><a href="#futher-setup"><span class="toc-section-number">4</span> Futher Setup</a></li>
</ul>
</div>

<p>First, you should load <code>recharts</code>:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">library</span>(recharts)</code></pre></div>
<div id="introduction" class="section level1">
<h1><span class="header-section-number">1</span> Introduction</h1>
<p>Line plot includes 4 basic types:</p>
<ul>
<li>line: line</li>
<li>curve (smooth line): curve</li>
<li>area: area</li>
<li>wave (smooth area): wave</li>
</ul>
<table id="intro">
<tr>
<td>
<div id="htmlwidget-6510f4d41bc6f0563ba7" style="width:400px;height:300px;" class="echarts html-widget"></div>
<script type="application/json" data-for="htmlwidget-6510f4d41bc6f0563ba7">{"x":{"series":[{"name":"No","type":"line","data":[122,167,528,673],"showAllSymbol":true},{"name":"Yes","type":"line","data":[203,118,178,212],"showAllSymbol":true}],"legend":{"show":true,"data":["No","Yes"],"x":"right","y":"center","orient":"vertical"},"yAxis":[{"type":"value","show":true,"position":"left","name":"Count","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"xAxis":[{"type":"category","show":true,"position":"bottom","name":"Class","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false},"data":["1st","2nd","3rd","Crew"]}],"tooltip":{"show":true,"trigger":"axis","axisPointer":{"type":"line","crossStyle":{"type":"dashed"},"lineStyle":{"type":"solid","width":1},"shadowStyle":{"color":"rgba(150,150,150,0.3)","width":"auto","type":"default"}},"textStyle":{"color":"#fff"},"formatter":"function (params) {\n       var i;\n       var j;\n       var text;\n       var text1;\n       var sName = \"\";\n       if (params.length > 1){\n            if (params[0].value.length >1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       } else {\n            if (params[0].value.length > 1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       }\n       if (params.length > 1){\n           text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n           for (i = 1; i < params.length; i++) {\n                if (params[i].value.length > 1){\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value[0];\n                   for (j = 1; j < params[i].value.length; j++){\n                        text += \", \" + params[i].value[j];\n                   }\n                } else {\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value;\n                }\n           }\n       } else {\n           if (params[0].seriesName){\n               text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           } else {\n               text += \" :  \" + text1;\n           }\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n       }\n       return text;\n    }","islandFormatter":"{a} < br/>{b} : {c}","enterable":false,"showDelay":20,"hideDelay":100,"transitionDuration":0.4,"backgroundColor":"rgba(0,0,0,0.7)","borderColor":"#333","borderWidth":0,"borderRadius":4},"toolbox":{"show":true,"feature":{"mark":{"show":true},"dataZoom":{"show":true},"dataView":{"show":true,"readOnly":false},"magicType":{"show":true,"type":["line","bar","tiled","stack"]},"restore":{"show":true},"saveAsImage":{"show":true}},"x":"right","y":"top","orient":"horizontal"},"theme":"infographic","title":{"text":"Titanic: Survival by Cabin Class","subtext":"line","x":"center","y":"bottom","orient":"horizontal"}},"evals":["tooltip.formatter"],"jsHooks":[]}</script>
</td>
<td>
<div id="htmlwidget-fbbdef027c1b8a8378a6" style="width:400px;height:300px;" class="echarts html-widget"></div>
<script type="application/json" data-for="htmlwidget-fbbdef027c1b8a8378a6">{"x":{"series":[{"name":"No","type":"line","data":[122,167,528,673],"smooth":true,"showAllSymbol":true},{"name":"Yes","type":"line","data":[203,118,178,212],"showAllSymbol":true}],"legend":{"show":true,"data":["No","Yes"],"x":"right","y":"center","orient":"vertical"},"yAxis":[{"type":"value","show":true,"position":"left","name":"Count","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"xAxis":[{"type":"category","show":true,"position":"bottom","name":"Class","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false},"data":["1st","2nd","3rd","Crew"]}],"tooltip":{"show":true,"trigger":"axis","axisPointer":{"type":"line","crossStyle":{"type":"dashed"},"lineStyle":{"type":"solid","width":1},"shadowStyle":{"color":"rgba(150,150,150,0.3)","width":"auto","type":"default"}},"textStyle":{"color":"#fff"},"formatter":"function (params) {\n       var i;\n       var j;\n       var text;\n       var text1;\n       var sName = \"\";\n       if (params.length > 1){\n            if (params[0].value.length >1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       } else {\n            if (params[0].value.length > 1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       }\n       if (params.length > 1){\n           text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n           for (i = 1; i < params.length; i++) {\n                if (params[i].value.length > 1){\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value[0];\n                   for (j = 1; j < params[i].value.length; j++){\n                        text += \", \" + params[i].value[j];\n                   }\n                } else {\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value;\n                }\n           }\n       } else {\n           if (params[0].seriesName){\n               text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           } else {\n               text += \" :  \" + text1;\n           }\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n       }\n       return text;\n    }","islandFormatter":"{a} < br/>{b} : {c}","enterable":false,"showDelay":20,"hideDelay":100,"transitionDuration":0.4,"backgroundColor":"rgba(0,0,0,0.7)","borderColor":"#333","borderWidth":0,"borderRadius":4},"toolbox":{"show":true,"feature":{"mark":{"show":true},"dataZoom":{"show":true},"dataView":{"show":true,"readOnly":false},"magicType":{"show":true,"type":["line","bar","tiled","stack"]},"restore":{"show":true},"saveAsImage":{"show":true}},"x":"right","y":"top","orient":"horizontal"},"theme":"roma","title":{"text":"Titanic: Outcome by Cabin Class","subtext":"curve","x":"center","y":"bottom","orient":"horizontal"}},"evals":["tooltip.formatter"],"jsHooks":[]}</script>
</td>
</tr>
<tr>
<td>
<div id="htmlwidget-ac1375e8440538b1fc3b" style="width:400px;height:300px;" class="echarts html-widget"></div>
<script type="application/json" data-for="htmlwidget-ac1375e8440538b1fc3b">{"x":{"series":[{"name":"No","type":"line","data":[122,167,528,673],"itemStyle":{"normal":{"areaStyle":{"type":"default"}}},"showAllSymbol":true},{"name":"Yes","type":"line","data":[203,118,178,212],"itemStyle":{"normal":{"areaStyle":{"type":"default"}}},"showAllSymbol":true}],"legend":{"show":true,"data":["No","Yes"],"x":"right","y":"center","orient":"vertical"},"yAxis":[{"type":"value","show":true,"position":"left","name":"Count","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"xAxis":[{"type":"category","show":true,"position":"bottom","name":"Class","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false},"data":["1st","2nd","3rd","Crew"]}],"tooltip":{"show":true,"trigger":"axis","axisPointer":{"type":"line","crossStyle":{"type":"dashed"},"lineStyle":{"type":"solid","width":1},"shadowStyle":{"color":"rgba(150,150,150,0.3)","width":"auto","type":"default"}},"textStyle":{"color":"#fff"},"formatter":"function (params) {\n       var i;\n       var j;\n       var text;\n       var text1;\n       var sName = \"\";\n       if (params.length > 1){\n            if (params[0].value.length >1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       } else {\n            if (params[0].value.length > 1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       }\n       if (params.length > 1){\n           text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n           for (i = 1; i < params.length; i++) {\n                if (params[i].value.length > 1){\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value[0];\n                   for (j = 1; j < params[i].value.length; j++){\n                        text += \", \" + params[i].value[j];\n                   }\n                } else {\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value;\n                }\n           }\n       } else {\n           if (params[0].seriesName){\n               text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           } else {\n               text += \" :  \" + text1;\n           }\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n       }\n       return text;\n    }","islandFormatter":"{a} < br/>{b} : {c}","enterable":false,"showDelay":20,"hideDelay":100,"transitionDuration":0.4,"backgroundColor":"rgba(0,0,0,0.7)","borderColor":"#333","borderWidth":0,"borderRadius":4},"toolbox":{"show":true,"feature":{"mark":{"show":true},"dataZoom":{"show":true},"dataView":{"show":true,"readOnly":false},"magicType":{"show":true,"type":["line","bar","tiled","stack"]},"restore":{"show":true},"saveAsImage":{"show":true}},"x":"right","y":"top","orient":"horizontal"},"theme":"macarons","title":{"text":"Titanic: Survival by Cabin Class","subtext":"area","x":"center","y":"bottom","orient":"horizontal"}},"evals":["tooltip.formatter"],"jsHooks":[]}</script>
</td>
<td>
<div id="htmlwidget-08d45c5f0bd51fb1b298" style="width:400px;height:300px;" class="echarts html-widget"></div>
<script type="application/json" data-for="htmlwidget-08d45c5f0bd51fb1b298">{"x":{"series":[{"name":"No","type":"line","data":[122,167,528,673],"itemStyle":{"normal":{"areaStyle":{"type":"default"}}},"smooth":true,"showAllSymbol":true},{"name":"Yes","type":"line","data":[203,118,178,212],"itemStyle":{"normal":{"areaStyle":{"type":"default"}}},"showAllSymbol":true}],"legend":{"show":true,"data":["No","Yes"],"x":"right","y":"center","orient":"vertical"},"yAxis":[{"type":"value","show":true,"position":"left","name":"Count","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"xAxis":[{"type":"category","show":true,"position":"bottom","name":"Class","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false},"data":["1st","2nd","3rd","Crew"]}],"tooltip":{"show":true,"trigger":"axis","axisPointer":{"type":"line","crossStyle":{"type":"dashed"},"lineStyle":{"type":"solid","width":1},"shadowStyle":{"color":"rgba(150,150,150,0.3)","width":"auto","type":"default"}},"textStyle":{"color":"#fff"},"formatter":"function (params) {\n       var i;\n       var j;\n       var text;\n       var text1;\n       var sName = \"\";\n       if (params.length > 1){\n            if (params[0].value.length >1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       } else {\n            if (params[0].value.length > 1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       }\n       if (params.length > 1){\n           text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n           for (i = 1; i < params.length; i++) {\n                if (params[i].value.length > 1){\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value[0];\n                   for (j = 1; j < params[i].value.length; j++){\n                        text += \", \" + params[i].value[j];\n                   }\n                } else {\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value;\n                }\n           }\n       } else {\n           if (params[0].seriesName){\n               text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           } else {\n               text += \" :  \" + text1;\n           }\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n       }\n       return text;\n    }","islandFormatter":"{a} < br/>{b} : {c}","enterable":false,"showDelay":20,"hideDelay":100,"transitionDuration":0.4,"backgroundColor":"rgba(0,0,0,0.7)","borderColor":"#333","borderWidth":0,"borderRadius":4},"toolbox":{"show":true,"feature":{"mark":{"show":true},"dataZoom":{"show":true},"dataView":{"show":true,"readOnly":false},"magicType":{"show":true,"type":["line","bar","tiled","stack"]},"restore":{"show":true},"saveAsImage":{"show":true}},"x":"right","y":"top","orient":"horizontal"},"theme":"macarons2","title":{"text":"Titanic: Outcome by Cabin Class","subtext":"wave","x":"center","y":"bottom","orient":"horizontal"}},"evals":["tooltip.formatter"],"jsHooks":[]}</script>
</td>
</tr>
</table>
<p>The keys are:</p>
<ul>
<li>character <code>x</code> and numeric <code>y</code></li>
<li>each combination level of <code>x</code> (and <code>series</code>) can only have one <code>y</code> data point</li>
<li>Tiled and stacked bar/column charts can shift from one to another by clicking type shift buttons in the toolbox widget.</li>
<li>Line/area can shift to bar charts easily using buttons in toolbox widget.</li>
</ul>
</div>
<div id="function-call" class="section level1">
<h1><span class="header-section-number">2</span> Function Call</h1>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">echartr</span>(data, x, y, &lt;series&gt;, &lt;weight&gt;, &lt;t&gt;, &lt;type&gt;, &lt;subtype&gt;)</code></pre></div>
<table>
<colgroup>
<col width="12%" />
<col width="87%" />
</colgroup>
<thead>
<tr class="header">
<th>Arg</th>
<th>Requirement</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><p><strong>data</strong></p></td>
<td><p>source data in the form of data.frame</p></td>
</tr>
<tr class="even">
<td><p><strong>x</strong></p></td>
<td><p>character independent variable. Other type will be coerced to factors. Only the first one is accepted if multiple variables are provided.</p></td>
</tr>
<tr class="odd">
<td><p><strong>y</strong></p></td>
<td><p>numeric dependent variable. Only the first one is accepted if multiple variables are provided.</p></td>
</tr>
<tr class="even">
<td><p>series</p></td>
<td><p>data series variable which will be coerced to factors. Only the first one is accepted if multiple variables are provided.</p></td>
</tr>
<tr class="odd">
<td><p>weight</p></td>
<td><p>weight is mapped to the lineWidth of the chart by series</p></td>
</tr>
<tr class="even">
<td><p>t</p></td>
<td><p>timeline variable which will be coerced to factors. Only the first one is accepted if multiple variables are provided.</p></td>
</tr>
<tr class="odd">
<td><p>type</p></td>
<td><p>‘line’, ‘curve’, ‘area’, ‘wave’</p></td>
</tr>
<tr class="even">
<td><p>subtype</p></td>
<td><ul>
<li>line: c(“stack”,“smooth”,“dotted”,“solid”,“dashed”)
<ul>
<li>stack: stacked series</li>
<li>smooth: smooth line</li>
<li>dotted: use dotted line</li>
<li>solid: use solid line (default)</li>
<li>dashed: use dashed line</li>
</ul></li>
<li>curve: c(“stack”,“solid”)</li>
<li>area: c(“stack”,“smooth”,“dotted”,“solid”,“dashed”)</li>
<li>wave: c(“stack”,“solid”)</li>
</ul></td>
</tr>
</tbody>
</table>
</div>
<div id="showcase" class="section level1">
<h1><span class="header-section-number">3</span> Showcase</h1>
<div id="data-preparation" class="section level2">
<h2><span class="header-section-number">3.1</span> Data Preparation</h2>
<p>Let’s look into <code>airquality</code> dataset embeded in the package <code>datasets</code>. The structure of the data.frame is as below:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">aq &lt;-<span class="st"> </span>airquality
aq$Date &lt;-<span class="st"> </span><span class="kw">as.Date</span>(<span class="kw">paste</span>(<span class="st">&#39;1973&#39;</span>, aq$Month, aq$Day, <span class="dt">sep=</span><span class="st">&#39;-&#39;</span>))
aq$Day &lt;-<span class="st"> </span><span class="kw">as.character</span>(aq$Day)
aq$Month &lt;-<span class="st"> </span><span class="kw">factor</span>(aq$Month, <span class="dt">labels=</span><span class="kw">c</span>(<span class="st">&quot;May&quot;</span>, <span class="st">&quot;Jun&quot;</span>, <span class="st">&quot;Jul&quot;</span>, <span class="st">&quot;Aug&quot;</span>, <span class="st">&quot;Sep&quot;</span>))
<span class="kw">head</span>(aq)</code></pre></div>
<pre><code>##   Ozone Solar.R Wind Temp Month Day       Date
## 1    41     190  7.4   67   May   1 1973-05-01
## 2    36     118  8.0   72   May   2 1973-05-02
## 3    12     149 12.6   74   May   3 1973-05-03
## 4    18     313 11.5   62   May   4 1973-05-04
## 5    NA      NA 14.3   56   May   5 1973-05-05
## 6    28      NA 14.9   66   May   6 1973-05-06</code></pre>
</div>
<div id="line-chart" class="section level2">
<h2><span class="header-section-number">3.2</span> Line Chart</h2>
<div id="singular-series" class="section level3">
<h3><span class="header-section-number">3.2.1</span> Singular Series</h3>
<p><code>type</code> is set ‘line’.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">echartr</span>(aq, Date, Temp, <span class="dt">type=</span><span class="st">&#39;line&#39;</span>) %&gt;%
<span class="st">    </span><span class="kw">setTitle</span>(<span class="st">&#39;NY Temperature May - Sep 1973&#39;</span>) %&gt;%<span class="st"> </span><span class="kw">setSymbols</span>(<span class="st">&#39;none&#39;</span>)</code></pre></div>
<div id="htmlwidget-635103b13b447a7029d7" style="width:672px;height:480px;" class="echarts html-widget"></div>
<script type="application/json" data-for="htmlwidget-635103b13b447a7029d7">{"x":{"series":[{"type":"line","data":[[105033600000,67],[105120000000,72],[105206400000,74],[105292800000,62],[105379200000,56],[105465600000,66],[105552000000,65],[105638400000,59],[105724800000,61],[105811200000,69],[105897600000,74],[105984000000,69],[106070400000,66],[106156800000,68],[106243200000,58],[106329600000,64],[106416000000,66],[106502400000,57],[106588800000,68],[106675200000,62],[106761600000,59],[106848000000,73],[106934400000,61],[107020800000,61],[107107200000,57],[107193600000,58],[107280000000,57],[107366400000,67],[107452800000,81],[107539200000,79],[107625600000,76],[107712000000,78],[107798400000,74],[107884800000,67],[107971200000,84],[108057600000,85],[108144000000,79],[108230400000,82],[108316800000,87],[108403200000,90],[108489600000,87],[108576000000,93],[108662400000,92],[108748800000,82],[108835200000,80],[108921600000,79],[109008000000,77],[109094400000,72],[109180800000,65],[109267200000,73],[109353600000,76],[109440000000,77],[109526400000,76],[109612800000,76],[109699200000,76],[109785600000,75],[109872000000,78],[109958400000,73],[110044800000,80],[110131200000,77],[110217600000,83],[110304000000,84],[110390400000,85],[110476800000,81],[110563200000,84],[110649600000,83],[110736000000,83],[110822400000,88],[110908800000,92],[110995200000,92],[111081600000,89],[111168000000,82],[111254400000,73],[111340800000,81],[111427200000,91],[111513600000,80],[111600000000,81],[111686400000,82],[111772800000,84],[111859200000,87],[111945600000,85],[112032000000,74],[112118400000,81],[112204800000,82],[112291200000,86],[112377600000,85],[112464000000,82],[112550400000,86],[112636800000,88],[112723200000,86],[112809600000,83],[112896000000,81],[112982400000,81],[113068800000,81],[113155200000,82],[113241600000,86],[113328000000,85],[113414400000,87],[113500800000,89],[113587200000,90],[113673600000,90],[113760000000,92],[113846400000,86],[113932800000,86],[114019200000,82],[114105600000,80],[114192000000,79],[114278400000,77],[114364800000,79],[114451200000,76],[114537600000,78],[114624000000,78],[114710400000,77],[114796800000,72],[114883200000,75],[114969600000,79],[115056000000,81],[115142400000,86],[115228800000,88],[115315200000,97],[115401600000,94],[115488000000,96],[115574400000,94],[115660800000,91],[115747200000,92],[115833600000,93],[115920000000,93],[116006400000,87],[116092800000,84],[116179200000,80],[116265600000,78],[116352000000,75],[116438400000,73],[116524800000,81],[116611200000,76],[116697600000,77],[116784000000,71],[116870400000,71],[116956800000,78],[117043200000,67],[117129600000,76],[117216000000,68],[117302400000,82],[117388800000,64],[117475200000,71],[117561600000,81],[117648000000,69],[117734400000,63],[117820800000,70],[117907200000,77],[117993600000,75],[118080000000,76],[118166400000,68]],"showAllSymbol":true}],"yAxis":[{"type":"value","show":true,"position":"left","name":"Temp","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"xAxis":[{"type":"time","show":true,"position":"bottom","name":"Date","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"tooltip":{"show":true,"trigger":"item","axisPointer":{"type":"line","crossStyle":{"type":"dashed"},"lineStyle":{"type":"solid","width":1},"shadowStyle":{"color":"rgba(150,150,150,0.3)","width":"auto","type":"default"}},"textStyle":{"color":"#fff"},"formatter":"function (params) {\n       var i;\n       var j;\n       var sDate;\n       var text;\n       var text1;\n       var sName = \"\";\n       if (params.length > 1){\n            if (params[0].value.length >1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            sDate = new Date(text1);\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       } else {\n            if (params.value.length > 1) {\n                text1 = params.value[0];\n            } else {\n                text1 = params.value;\n            }\n            sDate = new Date(text1);\n            text = params.name;\n            if (params.seriesName) {\n                sName = params.seriesName;\n            }\n       }\n       if (sDate.getMonth && !isNaN(sDate.getMonth())) {\n            if (sDate.getMinutes() < 10) {\n                min = \"0\" + sDate.getMinutes();\n            } else {\n                min = sDate.getMinutes();\n            }\n            if (sDate.getSeconds() < 10) {\n                sec = \"0\" + sDate.getSeconds();\n            } else {\n                sec = sDate.getSeconds();\n            }\n            text1 = sName + sDate.getFullYear() + \"-\"\n                + (sDate.getMonth() + 1) + \"-\"\n                + sDate.getDate() + \" \"\n                + sDate.getHours() + \":\" + min + \":\" + sec;\n       }\n       if (params.length > 1) {\n           text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++) {\n                    text += \", \" + params[0].value[j];\n                }\n           }\n           for (i = 1; i < params.length; i++) {\n                if (params[i].value.length > 1) {\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value[0];\n                   for (j = 1; j < params[i].value.length; j++) {\n                        text += \", \" + params[i].value[j];\n                   }\n                } else {\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value;\n                }\n           }\n       } else {\n           if (params.seriesName) {\n               text += \"<br/>\" + params.seriesName + \" :  \" + text1;\n           } else {\n               text = text1;\n           }\n           if (params.value.length > 1){\n                for (j = 1; j < params.value.length; j++) {\n                    text += \", \" + params.value[j];\n                }\n           }\n       }\n       return text;\n    }","islandFormatter":"{a} < br/>{b} : {c}","enterable":false,"showDelay":20,"hideDelay":100,"transitionDuration":0.4,"backgroundColor":"rgba(0,0,0,0.7)","borderColor":"#333","borderWidth":0,"borderRadius":4},"toolbox":{"show":true,"feature":{"mark":{"show":true},"dataZoom":{"show":true},"dataView":{"show":true,"readOnly":false},"magicType":{"show":true,"type":["line","bar","tiled","stack"]},"restore":{"show":true},"saveAsImage":{"show":true}},"x":"right","y":"top","orient":"horizontal"},"legend":{"show":true,"data":[],"x":"left","y":"top","orient":"horizontal"},"title":{"text":"NY Temperature May - Sep 1973","x":"center","y":"bottom","orient":"horizontal"},"symbolList":["none"]},"evals":["tooltip.formatter"],"jsHooks":[]}</script>
</div>
<div id="multiple-series" class="section level3">
<h3><span class="header-section-number">3.2.2</span> Multiple Series</h3>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">echartr</span>(aq, Day, Temp, Month, <span class="dt">type=</span><span class="st">&#39;line&#39;</span>) %&gt;%
<span class="st">    </span><span class="kw">setTitle</span>(<span class="st">&#39;NY Temperature May - Sep 1973, by Month&#39;</span>) %&gt;%<span class="st"> </span>
<span class="st">    </span><span class="kw">setSymbols</span>(<span class="st">&#39;emptycircle&#39;</span>)</code></pre></div>
<div id="htmlwidget-7d9ba895c7f3267cc2e7" style="width:672px;height:480px;" class="echarts html-widget"></div>
<script type="application/json" data-for="htmlwidget-7d9ba895c7f3267cc2e7">{"x":{"series":[{"name":"May","type":"line","data":[67,72,74,62,56,66,65,59,61,69,74,69,66,68,58,64,66,57,68,62,59,73,61,61,57,58,57,67,81,79,76],"showAllSymbol":true},{"name":"Jun","type":"line","data":[78,74,67,84,85,79,82,87,90,87,93,92,82,80,79,77,72,65,73,76,77,76,76,76,75,78,73,80,77,83,"-"],"showAllSymbol":true},{"name":"Jul","type":"line","data":[84,85,81,84,83,83,88,92,92,89,82,73,81,91,80,81,82,84,87,85,74,81,82,86,85,82,86,88,86,83,81],"showAllSymbol":true},{"name":"Aug","type":"line","data":[81,81,82,86,85,87,89,90,90,92,86,86,82,80,79,77,79,76,78,78,77,72,75,79,81,86,88,97,94,96,94],"showAllSymbol":true},{"name":"Sep","type":"line","data":[91,92,93,93,87,84,80,78,75,73,81,76,77,71,71,78,67,76,68,82,64,71,81,69,63,70,77,75,76,68,"-"],"showAllSymbol":true}],"legend":{"show":true,"data":["May","Jun","Jul","Aug","Sep"],"x":"left","y":"top","orient":"horizontal"},"yAxis":[{"type":"value","show":true,"position":"left","name":"Temp","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"xAxis":[{"type":"category","show":true,"position":"bottom","name":"Day","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false},"data":["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"]}],"tooltip":{"show":true,"trigger":"axis","axisPointer":{"type":"line","crossStyle":{"type":"dashed"},"lineStyle":{"type":"solid","width":1},"shadowStyle":{"color":"rgba(150,150,150,0.3)","width":"auto","type":"default"}},"textStyle":{"color":"#fff"},"formatter":"function (params) {\n       var i;\n       var j;\n       var text;\n       var text1;\n       var sName = \"\";\n       if (params.length > 1){\n            if (params[0].value.length >1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       } else {\n            if (params[0].value.length > 1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       }\n       if (params.length > 1){\n           text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n           for (i = 1; i < params.length; i++) {\n                if (params[i].value.length > 1){\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value[0];\n                   for (j = 1; j < params[i].value.length; j++){\n                        text += \", \" + params[i].value[j];\n                   }\n                } else {\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value;\n                }\n           }\n       } else {\n           if (params[0].seriesName){\n               text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           } else {\n               text += \" :  \" + text1;\n           }\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n       }\n       return text;\n    }","islandFormatter":"{a} < br/>{b} : {c}","enterable":false,"showDelay":20,"hideDelay":100,"transitionDuration":0.4,"backgroundColor":"rgba(0,0,0,0.7)","borderColor":"#333","borderWidth":0,"borderRadius":4},"toolbox":{"show":true,"feature":{"mark":{"show":true},"dataZoom":{"show":true},"dataView":{"show":true,"readOnly":false},"magicType":{"show":true,"type":["line","bar","tiled","stack"]},"restore":{"show":true},"saveAsImage":{"show":true}},"x":"right","y":"top","orient":"horizontal"},"title":{"text":"NY Temperature May - Sep 1973, by Month","x":"center","y":"bottom","orient":"horizontal"},"symbolList":["emptyCircle","emptyCircle","emptyCircle","emptyCircle","emptyCircle"]},"evals":["tooltip.formatter"],"jsHooks":[]}</script>
</div>
<div id="stacked-line-chart" class="section level3">
<h3><span class="header-section-number">3.2.3</span> Stacked Line Chart</h3>
<p>Set <code>type</code> ‘line’ and <code>subtype</code> ‘stack’.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">echartr</span>(aq, Day, Temp, Month, <span class="dt">type=</span><span class="st">&#39;line&#39;</span>, <span class="dt">subtype=</span><span class="st">&#39;stack&#39;</span>) %&gt;%
<span class="st">    </span><span class="kw">setTitle</span>(<span class="st">&#39;NY Temperature May - Sep 1973, by Month&#39;</span>) %&gt;%<span class="st"> </span>
<span class="st">    </span><span class="kw">setSymbols</span>(<span class="st">&#39;emptycircle&#39;</span>)</code></pre></div>
<div id="htmlwidget-bc382ea8952937758f5c" style="width:672px;height:480px;" class="echarts html-widget"></div>
<script type="application/json" data-for="htmlwidget-bc382ea8952937758f5c">{"x":{"series":[{"name":"May","type":"line","data":[67,72,74,62,56,66,65,59,61,69,74,69,66,68,58,64,66,57,68,62,59,73,61,61,57,58,57,67,81,79,76],"stack":"Group","showAllSymbol":true},{"name":"Jun","type":"line","data":[78,74,67,84,85,79,82,87,90,87,93,92,82,80,79,77,72,65,73,76,77,76,76,76,75,78,73,80,77,83,"-"],"stack":"Group","showAllSymbol":true},{"name":"Jul","type":"line","data":[84,85,81,84,83,83,88,92,92,89,82,73,81,91,80,81,82,84,87,85,74,81,82,86,85,82,86,88,86,83,81],"stack":"Group","showAllSymbol":true},{"name":"Aug","type":"line","data":[81,81,82,86,85,87,89,90,90,92,86,86,82,80,79,77,79,76,78,78,77,72,75,79,81,86,88,97,94,96,94],"stack":"Group","showAllSymbol":true},{"name":"Sep","type":"line","data":[91,92,93,93,87,84,80,78,75,73,81,76,77,71,71,78,67,76,68,82,64,71,81,69,63,70,77,75,76,68,"-"],"stack":"Group","showAllSymbol":true}],"legend":{"show":true,"data":["May","Jun","Jul","Aug","Sep"],"x":"left","y":"top","orient":"horizontal"},"yAxis":[{"type":"value","show":true,"position":"left","name":"Temp","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"xAxis":[{"type":"category","show":true,"position":"bottom","name":"Day","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false},"data":["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"]}],"tooltip":{"show":true,"trigger":"axis","axisPointer":{"type":"line","crossStyle":{"type":"dashed"},"lineStyle":{"type":"solid","width":1},"shadowStyle":{"color":"rgba(150,150,150,0.3)","width":"auto","type":"default"}},"textStyle":{"color":"#fff"},"formatter":"function (params) {\n       var i;\n       var j;\n       var text;\n       var text1;\n       var sName = \"\";\n       if (params.length > 1){\n            if (params[0].value.length >1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       } else {\n            if (params[0].value.length > 1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       }\n       if (params.length > 1){\n           text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n           for (i = 1; i < params.length; i++) {\n                if (params[i].value.length > 1){\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value[0];\n                   for (j = 1; j < params[i].value.length; j++){\n                        text += \", \" + params[i].value[j];\n                   }\n                } else {\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value;\n                }\n           }\n       } else {\n           if (params[0].seriesName){\n               text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           } else {\n               text += \" :  \" + text1;\n           }\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n       }\n       return text;\n    }","islandFormatter":"{a} < br/>{b} : {c}","enterable":false,"showDelay":20,"hideDelay":100,"transitionDuration":0.4,"backgroundColor":"rgba(0,0,0,0.7)","borderColor":"#333","borderWidth":0,"borderRadius":4},"toolbox":{"show":true,"feature":{"mark":{"show":true},"dataZoom":{"show":true},"dataView":{"show":true,"readOnly":false},"magicType":{"show":true,"type":["line","bar","tiled","stack"]},"restore":{"show":true},"saveAsImage":{"show":true}},"x":"right","y":"top","orient":"horizontal"},"title":{"text":"NY Temperature May - Sep 1973, by Month","x":"center","y":"bottom","orient":"horizontal"},"symbolList":["emptyCircle","emptyCircle","emptyCircle","emptyCircle","emptyCircle"]},"evals":["tooltip.formatter"],"jsHooks":[]}</script>
</div>
<div id="line-width-mapped-to-weight" class="section level3">
<h3><span class="header-section-number">3.2.4</span> Line Width Mapped to <code>Weight</code></h3>
<p>Let the lineWidth linked to the mean of Wind across series (Month).</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">echartr</span>(aq, Day, Temp, Month, <span class="dt">weight=</span>Wind, <span class="dt">type=</span><span class="st">&#39;line&#39;</span>) %&gt;%
<span class="st">    </span><span class="kw">setTitle</span>(<span class="st">&#39;NY Temperature May - Sep 1973, by Month&#39;</span>) %&gt;%<span class="st"> </span>
<span class="st">    </span><span class="kw">setSymbols</span>(<span class="st">&#39;emptycircle&#39;</span>)</code></pre></div>
<div id="htmlwidget-7aaa6efa95cd15ca9a1c" style="width:672px;height:480px;" class="echarts html-widget"></div>
<script type="application/json" data-for="htmlwidget-7aaa6efa95cd15ca9a1c">{"x":{"series":[{"name":"May","type":"line","data":[67,72,74,62,56,66,65,59,61,69,74,69,66,68,58,64,66,57,68,62,59,73,61,61,57,58,57,67,81,79,76],"itemStyle":{"normal":{"lineStyle":{"width":9}}},"showAllSymbol":true},{"name":"Jun","type":"line","data":[78,74,67,84,85,79,82,87,90,87,93,92,82,80,79,77,72,65,73,76,77,76,76,76,75,78,73,80,77,83,"-"],"itemStyle":{"normal":{"lineStyle":{"width":5.16571645762068}}},"showAllSymbol":true},{"name":"Jul","type":"line","data":[84,85,81,84,83,83,88,92,92,89,82,73,81,91,80,81,82,84,87,85,74,81,82,86,85,82,86,88,86,83,81],"itemStyle":{"normal":{"lineStyle":{"width":1.41961231470923}}},"showAllSymbol":true},{"name":"Aug","type":"line","data":[81,81,82,86,85,87,89,90,90,92,86,86,82,80,79,77,79,76,78,78,77,72,75,79,81,86,88,97,94,96,94],"itemStyle":{"normal":{"lineStyle":{"width":1}}},"showAllSymbol":true},{"name":"Sep","type":"line","data":[91,92,93,93,87,84,80,78,75,73,81,76,77,71,71,78,67,76,68,82,64,71,81,69,63,70,77,75,76,68,"-"],"itemStyle":{"normal":{"lineStyle":{"width":4.92063854047891}}},"showAllSymbol":true}],"legend":{"show":true,"data":["May","Jun","Jul","Aug","Sep"],"x":"left","y":"top","orient":"horizontal"},"yAxis":[{"type":"value","show":true,"position":"left","name":"Temp","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"xAxis":[{"type":"category","show":true,"position":"bottom","name":"Day","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false},"data":["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"]}],"tooltip":{"show":true,"trigger":"axis","axisPointer":{"type":"line","crossStyle":{"type":"dashed"},"lineStyle":{"type":"solid","width":1},"shadowStyle":{"color":"rgba(150,150,150,0.3)","width":"auto","type":"default"}},"textStyle":{"color":"#fff"},"formatter":"function (params) {\n       var i;\n       var j;\n       var text;\n       var text1;\n       var sName = \"\";\n       if (params.length > 1){\n            if (params[0].value.length >1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       } else {\n            if (params[0].value.length > 1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       }\n       if (params.length > 1){\n           text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n           for (i = 1; i < params.length; i++) {\n                if (params[i].value.length > 1){\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value[0];\n                   for (j = 1; j < params[i].value.length; j++){\n                        text += \", \" + params[i].value[j];\n                   }\n                } else {\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value;\n                }\n           }\n       } else {\n           if (params[0].seriesName){\n               text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           } else {\n               text += \" :  \" + text1;\n           }\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n       }\n       return text;\n    }","islandFormatter":"{a} < br/>{b} : {c}","enterable":false,"showDelay":20,"hideDelay":100,"transitionDuration":0.4,"backgroundColor":"rgba(0,0,0,0.7)","borderColor":"#333","borderWidth":0,"borderRadius":4},"toolbox":{"show":true,"feature":{"mark":{"show":true},"dataZoom":{"show":true},"dataView":{"show":true,"readOnly":false},"magicType":{"show":true,"type":["line","bar","tiled","stack"]},"restore":{"show":true},"saveAsImage":{"show":true}},"x":"right","y":"top","orient":"horizontal"},"title":{"text":"NY Temperature May - Sep 1973, by Month","x":"center","y":"bottom","orient":"horizontal"},"symbolList":["emptyCircle","emptyCircle","emptyCircle","emptyCircle","emptyCircle"]},"evals":["tooltip.formatter"],"jsHooks":[]}</script>
</div>
<div id="line-chart-with-timeline" class="section level3">
<h3><span class="header-section-number">3.2.5</span> Line Chart with Timeline</h3>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">echartr</span>(aq, Day, Temp, <span class="dt">t=</span>Month, <span class="dt">type=</span><span class="st">&#39;line&#39;</span>) %&gt;%
<span class="st">    </span><span class="kw">setTitle</span>(<span class="st">&#39;NY Temperature May - Sep 1973, by Month&#39;</span>) %&gt;%<span class="st"> </span>
<span class="st">    </span><span class="kw">setSymbols</span>(<span class="st">&#39;emptycircle&#39;</span>)</code></pre></div>
<div id="htmlwidget-5c4c6b60bbdba809cdd7" style="width:672px;height:480px;" class="echarts html-widget"></div>
<script type="application/json" data-for="htmlwidget-5c4c6b60bbdba809cdd7">{"x":{"timeline":{"type":"number","data":["May","Jun","Jul","Aug","Sep"],"x":80,"x2":80,"y2":50},"options":[{"series":[{"type":"line","data":[67,72,74,62,56,66,65,59,61,69,74,69,66,68,58,64,66,57,68,62,59,73,61,61,57,58,57,67,81,79,76],"showAllSymbol":true}],"yAxis":[{"type":"value","show":true,"position":"left","name":"Temp","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"xAxis":[{"type":"category","show":true,"position":"bottom","name":"Day","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false},"data":["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"]}],"tooltip":{"show":true,"trigger":"axis","axisPointer":{"type":"line","crossStyle":{"type":"dashed"},"lineStyle":{"type":"solid","width":1},"shadowStyle":{"color":"rgba(150,150,150,0.3)","width":"auto","type":"default"}},"textStyle":{"color":"#fff"},"formatter":"function (params) {\n       var i;\n       var j;\n       var text;\n       var text1;\n       var sName = \"\";\n       if (params.length > 1){\n            if (params[0].value.length >1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       } else {\n            if (params[0].value.length > 1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       }\n       if (params.length > 1){\n           text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n           for (i = 1; i < params.length; i++) {\n                if (params[i].value.length > 1){\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value[0];\n                   for (j = 1; j < params[i].value.length; j++){\n                        text += \", \" + params[i].value[j];\n                   }\n                } else {\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value;\n                }\n           }\n       } else {\n           if (params[0].seriesName){\n               text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           } else {\n               text += \" :  \" + text1;\n           }\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n       }\n       return text;\n    }","islandFormatter":"{a} < br/>{b} : {c}","enterable":false,"showDelay":20,"hideDelay":100,"transitionDuration":0.4,"backgroundColor":"rgba(0,0,0,0.7)","borderColor":"#333","borderWidth":0,"borderRadius":4},"toolbox":{"show":true,"feature":{"mark":{"show":true},"dataZoom":{"show":true},"dataView":{"show":true,"readOnly":false},"magicType":{"show":true,"type":["line","bar","tiled","stack"]},"restore":{"show":true},"saveAsImage":{"show":true}},"x":"right","y":"top","orient":"horizontal"},"legend":{"show":true,"data":[],"x":"left","y":"top","orient":"horizontal"},"title":{"text":"NY Temperature May - Sep 1973, by Month (Month: May)","x":"center","y":"bottom","orient":"horizontal"},"grid":{"y2":130},"symbolList":["emptyCircle"]},{"series":[{"type":"line","data":[78,74,67,84,85,79,82,87,90,87,93,92,82,80,79,77,72,65,73,76,77,76,76,76,75,78,73,80,77,83,"-"],"showAllSymbol":true}],"title":{"text":"NY Temperature May - Sep 1973, by Month (Month: Jun)","x":"center","y":"bottom","orient":"horizontal"}},{"series":[{"type":"line","data":[84,85,81,84,83,83,88,92,92,89,82,73,81,91,80,81,82,84,87,85,74,81,82,86,85,82,86,88,86,83,81],"showAllSymbol":true}],"title":{"text":"NY Temperature May - Sep 1973, by Month (Month: Jul)","x":"center","y":"bottom","orient":"horizontal"}},{"series":[{"type":"line","data":[81,81,82,86,85,87,89,90,90,92,86,86,82,80,79,77,79,76,78,78,77,72,75,79,81,86,88,97,94,96,94],"showAllSymbol":true}],"title":{"text":"NY Temperature May - Sep 1973, by Month (Month: Aug)","x":"center","y":"bottom","orient":"horizontal"}},{"series":[{"type":"line","data":[91,92,93,93,87,84,80,78,75,73,81,76,77,71,71,78,67,76,68,82,64,71,81,69,63,70,77,75,76,68,"-"],"showAllSymbol":true}],"title":{"text":"NY Temperature May - Sep 1973, by Month (Month: Sep)","x":"center","y":"bottom","orient":"horizontal"}}]},"evals":["options.0.tooltip.formatter"],"jsHooks":[]}</script>
</div>
</div>
<div id="curve-smooth-line-chart" class="section level2">
<h2><span class="header-section-number">3.3</span> Curve (Smooth Line) Chart</h2>
<div id="tiled-smooth-line-chart" class="section level3">
<h3><span class="header-section-number">3.3.1</span> Tiled Smooth Line Chart</h3>
<p>Set <code>type</code> ‘curve’.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">echartr</span>(aq, Day, Temp, Month, <span class="dt">type=</span><span class="st">&#39;curve&#39;</span>) %&gt;%
<span class="st">    </span><span class="kw">setTitle</span>(<span class="st">&#39;NY Temperature May - Sep 1973, by Month&#39;</span>) %&gt;%<span class="st"> </span>
<span class="st">    </span><span class="kw">setSymbols</span>(<span class="st">&#39;emptycircle&#39;</span>)</code></pre></div>
<div id="htmlwidget-9981f2e05d83a58c9676" style="width:672px;height:480px;" class="echarts html-widget"></div>
<script type="application/json" data-for="htmlwidget-9981f2e05d83a58c9676">{"x":{"series":[{"name":"May","type":"line","data":[67,72,74,62,56,66,65,59,61,69,74,69,66,68,58,64,66,57,68,62,59,73,61,61,57,58,57,67,81,79,76],"smooth":true,"showAllSymbol":true},{"name":"Jun","type":"line","data":[78,74,67,84,85,79,82,87,90,87,93,92,82,80,79,77,72,65,73,76,77,76,76,76,75,78,73,80,77,83,"-"],"showAllSymbol":true},{"name":"Jul","type":"line","data":[84,85,81,84,83,83,88,92,92,89,82,73,81,91,80,81,82,84,87,85,74,81,82,86,85,82,86,88,86,83,81],"showAllSymbol":true},{"name":"Aug","type":"line","data":[81,81,82,86,85,87,89,90,90,92,86,86,82,80,79,77,79,76,78,78,77,72,75,79,81,86,88,97,94,96,94],"showAllSymbol":true},{"name":"Sep","type":"line","data":[91,92,93,93,87,84,80,78,75,73,81,76,77,71,71,78,67,76,68,82,64,71,81,69,63,70,77,75,76,68,"-"],"showAllSymbol":true}],"legend":{"show":true,"data":["May","Jun","Jul","Aug","Sep"],"x":"left","y":"top","orient":"horizontal"},"yAxis":[{"type":"value","show":true,"position":"left","name":"Temp","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"xAxis":[{"type":"category","show":true,"position":"bottom","name":"Day","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false},"data":["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"]}],"tooltip":{"show":true,"trigger":"axis","axisPointer":{"type":"line","crossStyle":{"type":"dashed"},"lineStyle":{"type":"solid","width":1},"shadowStyle":{"color":"rgba(150,150,150,0.3)","width":"auto","type":"default"}},"textStyle":{"color":"#fff"},"formatter":"function (params) {\n       var i;\n       var j;\n       var text;\n       var text1;\n       var sName = \"\";\n       if (params.length > 1){\n            if (params[0].value.length >1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       } else {\n            if (params[0].value.length > 1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       }\n       if (params.length > 1){\n           text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n           for (i = 1; i < params.length; i++) {\n                if (params[i].value.length > 1){\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value[0];\n                   for (j = 1; j < params[i].value.length; j++){\n                        text += \", \" + params[i].value[j];\n                   }\n                } else {\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value;\n                }\n           }\n       } else {\n           if (params[0].seriesName){\n               text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           } else {\n               text += \" :  \" + text1;\n           }\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n       }\n       return text;\n    }","islandFormatter":"{a} < br/>{b} : {c}","enterable":false,"showDelay":20,"hideDelay":100,"transitionDuration":0.4,"backgroundColor":"rgba(0,0,0,0.7)","borderColor":"#333","borderWidth":0,"borderRadius":4},"toolbox":{"show":true,"feature":{"mark":{"show":true},"dataZoom":{"show":true},"dataView":{"show":true,"readOnly":false},"magicType":{"show":true,"type":["line","bar","tiled","stack"]},"restore":{"show":true},"saveAsImage":{"show":true}},"x":"right","y":"top","orient":"horizontal"},"title":{"text":"NY Temperature May - Sep 1973, by Month","x":"center","y":"bottom","orient":"horizontal"},"symbolList":["emptyCircle","emptyCircle","emptyCircle","emptyCircle","emptyCircle"]},"evals":["tooltip.formatter"],"jsHooks":[]}</script>
</div>
<div id="stacked-smooth-line-chart" class="section level3">
<h3><span class="header-section-number">3.3.2</span> Stacked Smooth Line Chart</h3>
<p>Set <code>type</code> ‘curve’ and <code>subtype</code> ‘stack’.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">echartr</span>(aq, Day, Temp, Month, <span class="dt">type=</span><span class="st">&#39;curve&#39;</span>, <span class="dt">subtype=</span><span class="st">&#39;stack&#39;</span>) %&gt;%
<span class="st">    </span><span class="kw">setTitle</span>(<span class="st">&#39;NY Temperature May - Sep 1973, by Month&#39;</span>) %&gt;%<span class="st"> </span>
<span class="st">    </span><span class="kw">setSymbols</span>(<span class="st">&#39;emptycircle&#39;</span>)</code></pre></div>
<div id="htmlwidget-11b5fb60d73bf673e2a0" style="width:672px;height:480px;" class="echarts html-widget"></div>
<script type="application/json" data-for="htmlwidget-11b5fb60d73bf673e2a0">{"x":{"series":[{"name":"May","type":"line","data":[67,72,74,62,56,66,65,59,61,69,74,69,66,68,58,64,66,57,68,62,59,73,61,61,57,58,57,67,81,79,76],"stack":"Group","smooth":true,"showAllSymbol":true},{"name":"Jun","type":"line","data":[78,74,67,84,85,79,82,87,90,87,93,92,82,80,79,77,72,65,73,76,77,76,76,76,75,78,73,80,77,83,"-"],"stack":"Group","showAllSymbol":true},{"name":"Jul","type":"line","data":[84,85,81,84,83,83,88,92,92,89,82,73,81,91,80,81,82,84,87,85,74,81,82,86,85,82,86,88,86,83,81],"stack":"Group","showAllSymbol":true},{"name":"Aug","type":"line","data":[81,81,82,86,85,87,89,90,90,92,86,86,82,80,79,77,79,76,78,78,77,72,75,79,81,86,88,97,94,96,94],"stack":"Group","showAllSymbol":true},{"name":"Sep","type":"line","data":[91,92,93,93,87,84,80,78,75,73,81,76,77,71,71,78,67,76,68,82,64,71,81,69,63,70,77,75,76,68,"-"],"stack":"Group","showAllSymbol":true}],"legend":{"show":true,"data":["May","Jun","Jul","Aug","Sep"],"x":"left","y":"top","orient":"horizontal"},"yAxis":[{"type":"value","show":true,"position":"left","name":"Temp","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"xAxis":[{"type":"category","show":true,"position":"bottom","name":"Day","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false},"data":["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"]}],"tooltip":{"show":true,"trigger":"axis","axisPointer":{"type":"line","crossStyle":{"type":"dashed"},"lineStyle":{"type":"solid","width":1},"shadowStyle":{"color":"rgba(150,150,150,0.3)","width":"auto","type":"default"}},"textStyle":{"color":"#fff"},"formatter":"function (params) {\n       var i;\n       var j;\n       var text;\n       var text1;\n       var sName = \"\";\n       if (params.length > 1){\n            if (params[0].value.length >1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       } else {\n            if (params[0].value.length > 1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       }\n       if (params.length > 1){\n           text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n           for (i = 1; i < params.length; i++) {\n                if (params[i].value.length > 1){\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value[0];\n                   for (j = 1; j < params[i].value.length; j++){\n                        text += \", \" + params[i].value[j];\n                   }\n                } else {\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value;\n                }\n           }\n       } else {\n           if (params[0].seriesName){\n               text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           } else {\n               text += \" :  \" + text1;\n           }\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n       }\n       return text;\n    }","islandFormatter":"{a} < br/>{b} : {c}","enterable":false,"showDelay":20,"hideDelay":100,"transitionDuration":0.4,"backgroundColor":"rgba(0,0,0,0.7)","borderColor":"#333","borderWidth":0,"borderRadius":4},"toolbox":{"show":true,"feature":{"mark":{"show":true},"dataZoom":{"show":true},"dataView":{"show":true,"readOnly":false},"magicType":{"show":true,"type":["line","bar","tiled","stack"]},"restore":{"show":true},"saveAsImage":{"show":true}},"x":"right","y":"top","orient":"horizontal"},"title":{"text":"NY Temperature May - Sep 1973, by Month","x":"center","y":"bottom","orient":"horizontal"},"symbolList":["emptyCircle","emptyCircle","emptyCircle","emptyCircle","emptyCircle"]},"evals":["tooltip.formatter"],"jsHooks":[]}</script>
</div>
</div>
<div id="area-chart" class="section level2">
<h2><span class="header-section-number">3.4</span> Area Chart</h2>
<div id="tiled-area-chart" class="section level3">
<h3><span class="header-section-number">3.4.1</span> Tiled Area Chart</h3>
<p>Area chart is exactly the same with line chart except that it has <code>areaStyle</code> feature specialized.</p>
<p>Set <code>type</code> ‘area’.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">echartr</span>(aq, Date, Temp, <span class="dt">type=</span><span class="st">&#39;area&#39;</span>) %&gt;%
<span class="st">    </span><span class="kw">setTitle</span>(<span class="st">&#39;NY Temperature May - Sep 1973&#39;</span>) %&gt;%<span class="st"> </span>
<span class="st">    </span><span class="kw">setSymbols</span>(<span class="st">&#39;emptycircle&#39;</span>)</code></pre></div>
<div id="htmlwidget-06947bb6faa8b6f21ff3" style="width:672px;height:480px;" class="echarts html-widget"></div>
<script type="application/json" data-for="htmlwidget-06947bb6faa8b6f21ff3">{"x":{"series":[{"type":"line","data":[[105033600000,67],[105120000000,72],[105206400000,74],[105292800000,62],[105379200000,56],[105465600000,66],[105552000000,65],[105638400000,59],[105724800000,61],[105811200000,69],[105897600000,74],[105984000000,69],[106070400000,66],[106156800000,68],[106243200000,58],[106329600000,64],[106416000000,66],[106502400000,57],[106588800000,68],[106675200000,62],[106761600000,59],[106848000000,73],[106934400000,61],[107020800000,61],[107107200000,57],[107193600000,58],[107280000000,57],[107366400000,67],[107452800000,81],[107539200000,79],[107625600000,76],[107712000000,78],[107798400000,74],[107884800000,67],[107971200000,84],[108057600000,85],[108144000000,79],[108230400000,82],[108316800000,87],[108403200000,90],[108489600000,87],[108576000000,93],[108662400000,92],[108748800000,82],[108835200000,80],[108921600000,79],[109008000000,77],[109094400000,72],[109180800000,65],[109267200000,73],[109353600000,76],[109440000000,77],[109526400000,76],[109612800000,76],[109699200000,76],[109785600000,75],[109872000000,78],[109958400000,73],[110044800000,80],[110131200000,77],[110217600000,83],[110304000000,84],[110390400000,85],[110476800000,81],[110563200000,84],[110649600000,83],[110736000000,83],[110822400000,88],[110908800000,92],[110995200000,92],[111081600000,89],[111168000000,82],[111254400000,73],[111340800000,81],[111427200000,91],[111513600000,80],[111600000000,81],[111686400000,82],[111772800000,84],[111859200000,87],[111945600000,85],[112032000000,74],[112118400000,81],[112204800000,82],[112291200000,86],[112377600000,85],[112464000000,82],[112550400000,86],[112636800000,88],[112723200000,86],[112809600000,83],[112896000000,81],[112982400000,81],[113068800000,81],[113155200000,82],[113241600000,86],[113328000000,85],[113414400000,87],[113500800000,89],[113587200000,90],[113673600000,90],[113760000000,92],[113846400000,86],[113932800000,86],[114019200000,82],[114105600000,80],[114192000000,79],[114278400000,77],[114364800000,79],[114451200000,76],[114537600000,78],[114624000000,78],[114710400000,77],[114796800000,72],[114883200000,75],[114969600000,79],[115056000000,81],[115142400000,86],[115228800000,88],[115315200000,97],[115401600000,94],[115488000000,96],[115574400000,94],[115660800000,91],[115747200000,92],[115833600000,93],[115920000000,93],[116006400000,87],[116092800000,84],[116179200000,80],[116265600000,78],[116352000000,75],[116438400000,73],[116524800000,81],[116611200000,76],[116697600000,77],[116784000000,71],[116870400000,71],[116956800000,78],[117043200000,67],[117129600000,76],[117216000000,68],[117302400000,82],[117388800000,64],[117475200000,71],[117561600000,81],[117648000000,69],[117734400000,63],[117820800000,70],[117907200000,77],[117993600000,75],[118080000000,76],[118166400000,68]],"itemStyle":{"normal":{"areaStyle":{"type":"default"}}},"showAllSymbol":true}],"yAxis":[{"type":"value","show":true,"position":"left","name":"Temp","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"xAxis":[{"type":"time","show":true,"position":"bottom","name":"Date","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"tooltip":{"show":true,"trigger":"item","axisPointer":{"type":"line","crossStyle":{"type":"dashed"},"lineStyle":{"type":"solid","width":1},"shadowStyle":{"color":"rgba(150,150,150,0.3)","width":"auto","type":"default"}},"textStyle":{"color":"#fff"},"formatter":"function (params) {\n       var i;\n       var j;\n       var sDate;\n       var text;\n       var text1;\n       var sName = \"\";\n       if (params.length > 1){\n            if (params[0].value.length >1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            sDate = new Date(text1);\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       } else {\n            if (params.value.length > 1) {\n                text1 = params.value[0];\n            } else {\n                text1 = params.value;\n            }\n            sDate = new Date(text1);\n            text = params.name;\n            if (params.seriesName) {\n                sName = params.seriesName;\n            }\n       }\n       if (sDate.getMonth && !isNaN(sDate.getMonth())) {\n            if (sDate.getMinutes() < 10) {\n                min = \"0\" + sDate.getMinutes();\n            } else {\n                min = sDate.getMinutes();\n            }\n            if (sDate.getSeconds() < 10) {\n                sec = \"0\" + sDate.getSeconds();\n            } else {\n                sec = sDate.getSeconds();\n            }\n            text1 = sName + sDate.getFullYear() + \"-\"\n                + (sDate.getMonth() + 1) + \"-\"\n                + sDate.getDate() + \" \"\n                + sDate.getHours() + \":\" + min + \":\" + sec;\n       }\n       if (params.length > 1) {\n           text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++) {\n                    text += \", \" + params[0].value[j];\n                }\n           }\n           for (i = 1; i < params.length; i++) {\n                if (params[i].value.length > 1) {\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value[0];\n                   for (j = 1; j < params[i].value.length; j++) {\n                        text += \", \" + params[i].value[j];\n                   }\n                } else {\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value;\n                }\n           }\n       } else {\n           if (params.seriesName) {\n               text += \"<br/>\" + params.seriesName + \" :  \" + text1;\n           } else {\n               text = text1;\n           }\n           if (params.value.length > 1){\n                for (j = 1; j < params.value.length; j++) {\n                    text += \", \" + params.value[j];\n                }\n           }\n       }\n       return text;\n    }","islandFormatter":"{a} < br/>{b} : {c}","enterable":false,"showDelay":20,"hideDelay":100,"transitionDuration":0.4,"backgroundColor":"rgba(0,0,0,0.7)","borderColor":"#333","borderWidth":0,"borderRadius":4},"toolbox":{"show":true,"feature":{"mark":{"show":true},"dataZoom":{"show":true},"dataView":{"show":true,"readOnly":false},"magicType":{"show":true,"type":["line","bar","tiled","stack"]},"restore":{"show":true},"saveAsImage":{"show":true}},"x":"right","y":"top","orient":"horizontal"},"legend":{"show":true,"data":[],"x":"left","y":"top","orient":"horizontal"},"title":{"text":"NY Temperature May - Sep 1973","x":"center","y":"bottom","orient":"horizontal"},"symbolList":["emptyCircle"]},"evals":["tooltip.formatter"],"jsHooks":[]}</script>
</div>
<div id="stacked-area-chart" class="section level3">
<h3><span class="header-section-number">3.4.2</span> Stacked Area Chart</h3>
<p>Set <code>type</code> ‘area’ and <code>subtype</code> ‘stack’.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">echartr</span>(aq, Day, Temp, Month, <span class="dt">type=</span><span class="st">&#39;area&#39;</span>, <span class="dt">subtype=</span><span class="st">&#39;stack&#39;</span>) %&gt;%
<span class="st">    </span><span class="kw">setTitle</span>(<span class="st">&#39;NY Temperature May - Sep 1973, by Month&#39;</span>) %&gt;%<span class="st"> </span>
<span class="st">    </span><span class="kw">setSymbols</span>(<span class="st">&#39;emptycircle&#39;</span>)</code></pre></div>
<div id="htmlwidget-b3c60ea284acb25557fc" style="width:672px;height:480px;" class="echarts html-widget"></div>
<script type="application/json" data-for="htmlwidget-b3c60ea284acb25557fc">{"x":{"series":[{"name":"May","type":"line","data":[67,72,74,62,56,66,65,59,61,69,74,69,66,68,58,64,66,57,68,62,59,73,61,61,57,58,57,67,81,79,76],"stack":"Group","itemStyle":{"normal":{"areaStyle":{"type":"default"}}},"showAllSymbol":true},{"name":"Jun","type":"line","data":[78,74,67,84,85,79,82,87,90,87,93,92,82,80,79,77,72,65,73,76,77,76,76,76,75,78,73,80,77,83,"-"],"stack":"Group","itemStyle":{"normal":{"areaStyle":{"type":"default"}}},"showAllSymbol":true},{"name":"Jul","type":"line","data":[84,85,81,84,83,83,88,92,92,89,82,73,81,91,80,81,82,84,87,85,74,81,82,86,85,82,86,88,86,83,81],"stack":"Group","itemStyle":{"normal":{"areaStyle":{"type":"default"}}},"showAllSymbol":true},{"name":"Aug","type":"line","data":[81,81,82,86,85,87,89,90,90,92,86,86,82,80,79,77,79,76,78,78,77,72,75,79,81,86,88,97,94,96,94],"stack":"Group","itemStyle":{"normal":{"areaStyle":{"type":"default"}}},"showAllSymbol":true},{"name":"Sep","type":"line","data":[91,92,93,93,87,84,80,78,75,73,81,76,77,71,71,78,67,76,68,82,64,71,81,69,63,70,77,75,76,68,"-"],"stack":"Group","itemStyle":{"normal":{"areaStyle":{"type":"default"}}},"showAllSymbol":true}],"legend":{"show":true,"data":["May","Jun","Jul","Aug","Sep"],"x":"left","y":"top","orient":"horizontal"},"yAxis":[{"type":"value","show":true,"position":"left","name":"Temp","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"xAxis":[{"type":"category","show":true,"position":"bottom","name":"Day","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false},"data":["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"]}],"tooltip":{"show":true,"trigger":"axis","axisPointer":{"type":"line","crossStyle":{"type":"dashed"},"lineStyle":{"type":"solid","width":1},"shadowStyle":{"color":"rgba(150,150,150,0.3)","width":"auto","type":"default"}},"textStyle":{"color":"#fff"},"formatter":"function (params) {\n       var i;\n       var j;\n       var text;\n       var text1;\n       var sName = \"\";\n       if (params.length > 1){\n            if (params[0].value.length >1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       } else {\n            if (params[0].value.length > 1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       }\n       if (params.length > 1){\n           text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n           for (i = 1; i < params.length; i++) {\n                if (params[i].value.length > 1){\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value[0];\n                   for (j = 1; j < params[i].value.length; j++){\n                        text += \", \" + params[i].value[j];\n                   }\n                } else {\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value;\n                }\n           }\n       } else {\n           if (params[0].seriesName){\n               text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           } else {\n               text += \" :  \" + text1;\n           }\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n       }\n       return text;\n    }","islandFormatter":"{a} < br/>{b} : {c}","enterable":false,"showDelay":20,"hideDelay":100,"transitionDuration":0.4,"backgroundColor":"rgba(0,0,0,0.7)","borderColor":"#333","borderWidth":0,"borderRadius":4},"toolbox":{"show":true,"feature":{"mark":{"show":true},"dataZoom":{"show":true},"dataView":{"show":true,"readOnly":false},"magicType":{"show":true,"type":["line","bar","tiled","stack"]},"restore":{"show":true},"saveAsImage":{"show":true}},"x":"right","y":"top","orient":"horizontal"},"title":{"text":"NY Temperature May - Sep 1973, by Month","x":"center","y":"bottom","orient":"horizontal"},"symbolList":["emptyCircle","emptyCircle","emptyCircle","emptyCircle","emptyCircle"]},"evals":["tooltip.formatter"],"jsHooks":[]}</script>
</div>
</div>
<div id="wave-smooth-area-chart" class="section level2">
<h2><span class="header-section-number">3.5</span> Wave (Smooth Area) Chart</h2>
<div id="tiled-smooth-area-chart" class="section level3">
<h3><span class="header-section-number">3.5.1</span> Tiled Smooth Area Chart</h3>
<p>Set <code>type</code> ‘wave’.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">echartr</span>(aq, Date, Temp, <span class="dt">type=</span><span class="st">&#39;wave&#39;</span>) %&gt;%
<span class="st">    </span><span class="kw">setTitle</span>(<span class="st">&#39;NY Temperature May - Sep 1973&#39;</span>) %&gt;%<span class="st"> </span>
<span class="st">    </span><span class="kw">setSymbols</span>(<span class="st">&#39;emptycircle&#39;</span>)</code></pre></div>
<div id="htmlwidget-5c063a45a0b26edbc17d" style="width:672px;height:480px;" class="echarts html-widget"></div>
<script type="application/json" data-for="htmlwidget-5c063a45a0b26edbc17d">{"x":{"series":[{"type":"line","data":[[105033600000,67],[105120000000,72],[105206400000,74],[105292800000,62],[105379200000,56],[105465600000,66],[105552000000,65],[105638400000,59],[105724800000,61],[105811200000,69],[105897600000,74],[105984000000,69],[106070400000,66],[106156800000,68],[106243200000,58],[106329600000,64],[106416000000,66],[106502400000,57],[106588800000,68],[106675200000,62],[106761600000,59],[106848000000,73],[106934400000,61],[107020800000,61],[107107200000,57],[107193600000,58],[107280000000,57],[107366400000,67],[107452800000,81],[107539200000,79],[107625600000,76],[107712000000,78],[107798400000,74],[107884800000,67],[107971200000,84],[108057600000,85],[108144000000,79],[108230400000,82],[108316800000,87],[108403200000,90],[108489600000,87],[108576000000,93],[108662400000,92],[108748800000,82],[108835200000,80],[108921600000,79],[109008000000,77],[109094400000,72],[109180800000,65],[109267200000,73],[109353600000,76],[109440000000,77],[109526400000,76],[109612800000,76],[109699200000,76],[109785600000,75],[109872000000,78],[109958400000,73],[110044800000,80],[110131200000,77],[110217600000,83],[110304000000,84],[110390400000,85],[110476800000,81],[110563200000,84],[110649600000,83],[110736000000,83],[110822400000,88],[110908800000,92],[110995200000,92],[111081600000,89],[111168000000,82],[111254400000,73],[111340800000,81],[111427200000,91],[111513600000,80],[111600000000,81],[111686400000,82],[111772800000,84],[111859200000,87],[111945600000,85],[112032000000,74],[112118400000,81],[112204800000,82],[112291200000,86],[112377600000,85],[112464000000,82],[112550400000,86],[112636800000,88],[112723200000,86],[112809600000,83],[112896000000,81],[112982400000,81],[113068800000,81],[113155200000,82],[113241600000,86],[113328000000,85],[113414400000,87],[113500800000,89],[113587200000,90],[113673600000,90],[113760000000,92],[113846400000,86],[113932800000,86],[114019200000,82],[114105600000,80],[114192000000,79],[114278400000,77],[114364800000,79],[114451200000,76],[114537600000,78],[114624000000,78],[114710400000,77],[114796800000,72],[114883200000,75],[114969600000,79],[115056000000,81],[115142400000,86],[115228800000,88],[115315200000,97],[115401600000,94],[115488000000,96],[115574400000,94],[115660800000,91],[115747200000,92],[115833600000,93],[115920000000,93],[116006400000,87],[116092800000,84],[116179200000,80],[116265600000,78],[116352000000,75],[116438400000,73],[116524800000,81],[116611200000,76],[116697600000,77],[116784000000,71],[116870400000,71],[116956800000,78],[117043200000,67],[117129600000,76],[117216000000,68],[117302400000,82],[117388800000,64],[117475200000,71],[117561600000,81],[117648000000,69],[117734400000,63],[117820800000,70],[117907200000,77],[117993600000,75],[118080000000,76],[118166400000,68]],"itemStyle":{"normal":{"areaStyle":{"type":"default"}}},"smooth":true,"showAllSymbol":true}],"yAxis":[{"type":"value","show":true,"position":"left","name":"Temp","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"xAxis":[{"type":"time","show":true,"position":"bottom","name":"Date","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"tooltip":{"show":true,"trigger":"item","axisPointer":{"type":"line","crossStyle":{"type":"dashed"},"lineStyle":{"type":"solid","width":1},"shadowStyle":{"color":"rgba(150,150,150,0.3)","width":"auto","type":"default"}},"textStyle":{"color":"#fff"},"formatter":"function (params) {\n       var i;\n       var j;\n       var sDate;\n       var text;\n       var text1;\n       var sName = \"\";\n       if (params.length > 1){\n            if (params[0].value.length >1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            sDate = new Date(text1);\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       } else {\n            if (params.value.length > 1) {\n                text1 = params.value[0];\n            } else {\n                text1 = params.value;\n            }\n            sDate = new Date(text1);\n            text = params.name;\n            if (params.seriesName) {\n                sName = params.seriesName;\n            }\n       }\n       if (sDate.getMonth && !isNaN(sDate.getMonth())) {\n            if (sDate.getMinutes() < 10) {\n                min = \"0\" + sDate.getMinutes();\n            } else {\n                min = sDate.getMinutes();\n            }\n            if (sDate.getSeconds() < 10) {\n                sec = \"0\" + sDate.getSeconds();\n            } else {\n                sec = sDate.getSeconds();\n            }\n            text1 = sName + sDate.getFullYear() + \"-\"\n                + (sDate.getMonth() + 1) + \"-\"\n                + sDate.getDate() + \" \"\n                + sDate.getHours() + \":\" + min + \":\" + sec;\n       }\n       if (params.length > 1) {\n           text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++) {\n                    text += \", \" + params[0].value[j];\n                }\n           }\n           for (i = 1; i < params.length; i++) {\n                if (params[i].value.length > 1) {\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value[0];\n                   for (j = 1; j < params[i].value.length; j++) {\n                        text += \", \" + params[i].value[j];\n                   }\n                } else {\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value;\n                }\n           }\n       } else {\n           if (params.seriesName) {\n               text += \"<br/>\" + params.seriesName + \" :  \" + text1;\n           } else {\n               text = text1;\n           }\n           if (params.value.length > 1){\n                for (j = 1; j < params.value.length; j++) {\n                    text += \", \" + params.value[j];\n                }\n           }\n       }\n       return text;\n    }","islandFormatter":"{a} < br/>{b} : {c}","enterable":false,"showDelay":20,"hideDelay":100,"transitionDuration":0.4,"backgroundColor":"rgba(0,0,0,0.7)","borderColor":"#333","borderWidth":0,"borderRadius":4},"toolbox":{"show":true,"feature":{"mark":{"show":true},"dataZoom":{"show":true},"dataView":{"show":true,"readOnly":false},"magicType":{"show":true,"type":["line","bar","tiled","stack"]},"restore":{"show":true},"saveAsImage":{"show":true}},"x":"right","y":"top","orient":"horizontal"},"legend":{"show":true,"data":[],"x":"left","y":"top","orient":"horizontal"},"title":{"text":"NY Temperature May - Sep 1973","x":"center","y":"bottom","orient":"horizontal"},"symbolList":["emptyCircle"]},"evals":["tooltip.formatter"],"jsHooks":[]}</script>
</div>
<div id="stacked-smooth-area-chart" class="section level3">
<h3><span class="header-section-number">3.5.2</span> Stacked Smooth Area Chart</h3>
<p>Set <code>type</code> ‘wave’ and <code>subtype</code> ‘stack’.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">echartr</span>(aq, Day, Temp, Month, <span class="dt">type=</span><span class="st">&#39;wave&#39;</span>, <span class="dt">subtype=</span><span class="st">&#39;stack&#39;</span>) %&gt;%
<span class="st">    </span><span class="kw">setTitle</span>(<span class="st">&#39;NY Temperature May - Sep 1973, by Month&#39;</span>) %&gt;%<span class="st"> </span>
<span class="st">    </span><span class="kw">setSymbols</span>(<span class="st">&#39;emptycircle&#39;</span>)</code></pre></div>
<div id="htmlwidget-b2f7f5393627d5f6cf28" style="width:672px;height:480px;" class="echarts html-widget"></div>
<script type="application/json" data-for="htmlwidget-b2f7f5393627d5f6cf28">{"x":{"series":[{"name":"May","type":"line","data":[67,72,74,62,56,66,65,59,61,69,74,69,66,68,58,64,66,57,68,62,59,73,61,61,57,58,57,67,81,79,76],"stack":"Group","itemStyle":{"normal":{"areaStyle":{"type":"default"}}},"smooth":true,"showAllSymbol":true},{"name":"Jun","type":"line","data":[78,74,67,84,85,79,82,87,90,87,93,92,82,80,79,77,72,65,73,76,77,76,76,76,75,78,73,80,77,83,"-"],"stack":"Group","itemStyle":{"normal":{"areaStyle":{"type":"default"}}},"showAllSymbol":true},{"name":"Jul","type":"line","data":[84,85,81,84,83,83,88,92,92,89,82,73,81,91,80,81,82,84,87,85,74,81,82,86,85,82,86,88,86,83,81],"stack":"Group","itemStyle":{"normal":{"areaStyle":{"type":"default"}}},"showAllSymbol":true},{"name":"Aug","type":"line","data":[81,81,82,86,85,87,89,90,90,92,86,86,82,80,79,77,79,76,78,78,77,72,75,79,81,86,88,97,94,96,94],"stack":"Group","itemStyle":{"normal":{"areaStyle":{"type":"default"}}},"showAllSymbol":true},{"name":"Sep","type":"line","data":[91,92,93,93,87,84,80,78,75,73,81,76,77,71,71,78,67,76,68,82,64,71,81,69,63,70,77,75,76,68,"-"],"stack":"Group","itemStyle":{"normal":{"areaStyle":{"type":"default"}}},"showAllSymbol":true}],"legend":{"show":true,"data":["May","Jun","Jul","Aug","Sep"],"x":"left","y":"top","orient":"horizontal"},"yAxis":[{"type":"value","show":true,"position":"left","name":"Temp","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"xAxis":[{"type":"category","show":true,"position":"bottom","name":"Day","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false},"data":["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"]}],"tooltip":{"show":true,"trigger":"axis","axisPointer":{"type":"line","crossStyle":{"type":"dashed"},"lineStyle":{"type":"solid","width":1},"shadowStyle":{"color":"rgba(150,150,150,0.3)","width":"auto","type":"default"}},"textStyle":{"color":"#fff"},"formatter":"function (params) {\n       var i;\n       var j;\n       var text;\n       var text1;\n       var sName = \"\";\n       if (params.length > 1){\n            if (params[0].value.length >1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       } else {\n            if (params[0].value.length > 1) {\n                text1 = params[0].value[0];\n            } else {\n                text1 = params[0].value;\n            }\n            text = params[0].name;\n            if (params[0].seriesName) {\n                sName = params[0].seriesName;\n            }\n       }\n       if (params.length > 1){\n           text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n           for (i = 1; i < params.length; i++) {\n                if (params[i].value.length > 1){\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value[0];\n                   for (j = 1; j < params[i].value.length; j++){\n                        text += \", \" + params[i].value[j];\n                   }\n                } else {\n                   text += \"<br/>\" + params[i].seriesName + \" :  \"\n                        + params[i].value;\n                }\n           }\n       } else {\n           if (params[0].seriesName){\n               text += \"<br/>\" + params[0].seriesName + \" :  \" + text1;\n           } else {\n               text += \" :  \" + text1;\n           }\n           if (params[0].value.length > 1){\n                for (j = 1; j < params[0].value.length; j++){\n                    text += \", \" + params[0].value[j];\n                }\n           }\n       }\n       return text;\n    }","islandFormatter":"{a} < br/>{b} : {c}","enterable":false,"showDelay":20,"hideDelay":100,"transitionDuration":0.4,"backgroundColor":"rgba(0,0,0,0.7)","borderColor":"#333","borderWidth":0,"borderRadius":4},"toolbox":{"show":true,"feature":{"mark":{"show":true},"dataZoom":{"show":true},"dataView":{"show":true,"readOnly":false},"magicType":{"show":true,"type":["line","bar","tiled","stack"]},"restore":{"show":true},"saveAsImage":{"show":true}},"x":"right","y":"top","orient":"horizontal"},"title":{"text":"NY Temperature May - Sep 1973, by Month","x":"center","y":"bottom","orient":"horizontal"},"symbolList":["emptyCircle","emptyCircle","emptyCircle","emptyCircle","emptyCircle"]},"evals":["tooltip.formatter"],"jsHooks":[]}</script>
</div>
</div>
</div>
<div id="futher-setup" class="section level1">
<h1><span class="header-section-number">4</span> Futher Setup</h1>
<p>Then you can configure the widgets, add markLines and/or markPoints, fortify the chart.</p>
<p>You can refer to related functions to play around on your own.</p>
</div>

<script type="text/javascript">
window.onload = function() {
  var i, fig = 1, caps = document.getElementsByClassName('caption');
  for (i = 0; i < caps.length; i++) {
    var cap = caps[i];
    if (cap.parentElement.className !== 'figure' || cap.nodeName !== 'P')
      continue;
    cap.innerHTML = '<span>Figure ' + fig + ':</span> ' + cap.innerHTML;
    fig++;
  }
  fig = 1;
  caps = document.getElementsByTagName('caption');
  for (i = 0; i < caps.length; i++) {
    var cap = caps[i];
    if (cap.parentElement.nodeName !== 'TABLE') continue;
    cap.innerHTML = '<span>Table ' + fig + ':</span> ' + cap.innerHTML;
    fig++;
  }
}
</script>



</div>

<script>

// add bootstrap table styles to pandoc tables
function bootstrapStylePandocTables() {
  $('tr.header').parent('thead').parent('table').addClass('table table-condensed');
}
$(document).ready(function () {
  bootstrapStylePandocTables();
});


</script>

<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
  (function () {
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src  = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
    document.getElementsByTagName("head")[0].appendChild(script);
  })();
</script>

</body>
</html>
